package com.qen.jiagoushi

import cn.hutool.core.lang.Console
import cn.hutool.core.util.IdUtil

fun main() {

    val list = ArrayList<Thread>()
    for (i in 0..10) {
        val thread = Thread {
            for (j in 0..10) {
                Console.log(
                    "${Thread.currentThread().threadId()}:${
                        IdUtil.getSnowflake(i.toLong(), j.toLong()).nextId()
                    }"
                )
            }
        }
        thread.start()
        list.add(thread)
    }
    list.forEach { t -> t.join() }

}